<?php
include_once('../public/header.php');
$config = include('../../public/config/config.php');
include('../../public/func/db.php');
$res = select($config,'category');
// var_dump($res);
?>
    <!--/sidebar-->
    <div class="main-wrap">
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin/design/">首页</a><span class="crumb-step">&gt;</span><a class="crumb-name" href="/jscss/admin/design/">文章管理</a><span class="crumb-step">&gt;</span><span>新增文章</span></div>
        </div>
        <div class="result-wrap">
            <div class="result-content">
                <form action="./doadd.php" method="post" id="myform" name="myform" enctype="multipart/form-data">
                    <table class="insert-tab" width="100%">
                        <tbody>
                            <tr>
                                <th width="120"><i class="require-red">*</i>分类：</th>
                                <td>
                                    <select name="cid" id="catid" class="required">
                                        <option value="0">请选择</option>
                                        <?php
                                            foreach($res as $k=>$v){
                                                echo '<option value="'.$v['id'].'">'.$v['title'].'</option>';
                                            }
                                        ?>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>发表用户id：</th>
                                <td>
                                    <input class="common-text required" id="title" name="uid" size="50" type="text">
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>文章标题：</th>
                                <td>
                                    <input class="common-text required" id="title" name="title" size="50" type="text">
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>配图：</th>
                                <td><input name="pic" id="" type="file"><!--<input type="submit" onclick="submitForm('/jscss/admin/design/upload')" value="上传图片"/>--></td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>文章内容：</th>
                                <td>
                                    <textarea name="content" id="" cols="57" rows="10"></textarea>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>标签（多个标签，逗号分隔）：</th>
                                <td>
                                    <input class="common-text required" id="title" name="tag" size="50" type="text">
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>状态：</th>
                                <td>
                                    <input  id="on" type="radio" name="status" value="1" checked>
                                    <label for="on">显示</label>&nbsp;&nbsp;
                                    <input  id="onon" type="radio" name="status" value="2">
                                    <label for="onon">置顶显示</label>&nbsp;&nbsp;
                                    <input  id="off" type="radio" name="status" value="0">
                                    <label for="off">隐藏</label>
                                </td>
                            </tr>
                            <tr>
                                <th></th>
                                <td>
                                    <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody></table>
                </form>
            </div>
        </div>

    </div>
    <!--/main-->
</div>
</body>
</html>